home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
nrpas13.arc
/
BCUCOF.DEM
< prev
next >
Wrap
Text File
|
1991-05-01
|
998b
|
40 lines
PROGRAM d3r10(input,output);
(* driver for routine BCUCOF *)
TYPE
gl4array = ARRAY [1..4] OF real;
gl4by4 = ARRAY [1..4,1..4] OF real;
VAR
d1,d2,ee,x1x2 : real;
i,j : integer;
y,y1,y2,y12,x1,x2 : gl4array;
c : gl4by4;
wt : ARRAY [1..16,1..16] OF real;
glflag : boolean;
(*$I MODFILE.PAS *)
(*$I BCUCOF.PAS *)
BEGIN
glflag := true;
x1[1] := 0.0; x1[2] := 2.0; x1[3] := 2.0; x1[4] := 0.0;
x2[1] := 0.0; x2[2] := 0.0; x2[3] := 2.0; x2[4] := 2.0;
d1 := x1[2]-x1[1];
d2 := x2[4]-x2[1];
FOR i := 1 to 4 DO BEGIN
x1x2 := x1[i]*x2[i];
ee := exp(-x1x2);
y[i] := x1x2*ee;
y1[i] := x2[i]*(1.0-x1x2)*ee;
y2[i] := x1[i]*(1.0-x1x2)*ee;
y12[i] := (1.0-3.0*x1x2+sqr(x1x2))*ee
END;
bcucof(y,y1,y2,y12,d1,d2,c);
writeln;
writeln('Coefficients for bicubic interpolation:');
writeln;
FOR i := 1 to 4 DO BEGIN
FOR j := 1 to 4 DO write(c[i,j]:12:6);
writeln
END
END.